package com.gxa.service.goods.impl;

import com.gxa.dao.goods.GoodsOneTypeMapper;
import com.gxa.dao.goods.GoodsTwoTypeMapper;
import com.gxa.pojo.goods.GoodsTwoType;
import com.gxa.service.goods.GoodsTwoTypeService;
import com.gxa.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class GoodsTwoTypeServiceimpl implements GoodsTwoTypeService {
    SqlSessionFactory sqlSessionFactory = SqlSessionFactoryUtils.getSqlSessionFactory();
    SqlSession sqlSession = sqlSessionFactory.openSession(true);
    GoodsTwoTypeMapper mapper = sqlSession.getMapper(GoodsTwoTypeMapper.class);
    @Override
    public int inserttwo(String twotypename,int tid) {
        int inserttwo = mapper.inserttwo(twotypename,tid);
        sqlSession.commit();
        return inserttwo;
    }

    @Override
    public List<GoodsTwoType> select() {
        List<GoodsTwoType> select = mapper.select();
        return select;
    }
}
